<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02DOM练习</title>
</head>
<body>
    <h1>我是标题:
        <span class="s">加钱居士</span>
    </h1>
    <input type="text" id="i1">
    <input type="text" id="i2">
<button onclick="f1()">加钱按钮</button>
<button onclick="f2()">按钮</button>
<script>
    function f1(){
        let span = document.querySelector('.s');
        console.log(span)
        span.innerHTML = '他可是我的亲朋好友,手足兄弟,得加钱';
    }
    function f2() {
        let input1 = document.querySelector('#i1');
        let input2 = document.getElementById('i2');
        console.log(input1);
        console.log(input1.value);
        console.log(input2);
        console.log(input2.value);
        let num = parseFloat(input1.value) + parseFloat(input2.value);
        console.log(num);
    }


</script>
</body>
</html>